package com.ysynzehao.dubbo.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.ysynzehao.dubbo.service.user.UserService;
import com.ysynzehao.dubbo.user.dao.UserMapper;
import com.ysynzehao.dubbo.user.model.User;

@Component
@Service
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserMapper userMapper;

	public User getUser(Long userId) {
		return userMapper.selectByPrimaryKey(userId);
	}

	public boolean saveUser(User user) {
		int result = userMapper.insert(user);
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	}

}
